<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>CSS3新增层次选择器</title>
    <style>
        div+p{
            width:100px;
            height:50px;
            border:solid 1px #000;
        }
        div~p{
            width:100px;
            height:50px;
            border:solid 1px #000;
        }
    </style>
</head>
<body>
    <p>p3</p>
    <div>div1</div>
    <p>p1</p>
    <p>p2</p>
</body>
</html>
